home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
23
/
striplf.zip
/
STRIPLF.DOC
< prev
next >
Wrap
Text File
|
1987-09-18
|
2KB
|
46 lines
September 18, 1987
striplf
I found that AT&T MS-DOS 3.2 sends carriage return (CR) and linefeed
(LF) when a file is redirected. I wanted to use a script file with
DEBUG like this:
C:> debug <script
What happened was after the first line, each line began with a LF
which caused DEBUG to declare an error. The system continued to
expect input from the redirection, which caused it to hang!
I wrote striplf.c to strip the LF out of a file. Other similar
programs I'm sure exist, but I didn't know of them. Striplf.c was
compiled using Ecosoft's ECOC C88 Compiler.
All striplf.c does is replace the LF character with CR.
Since the file is redirected from standard input, getchar() never
sees a CR character, only a LF. This is then replaced with only a
CR character.
Striplf.exe may be used at least in a couple of ways. One is using
redirection from standard input to standard output like so:
C:> striplf <script >script
This definitely works for small files, but may be limited. Beyond
the minimum file length (dependent upon clustersize) this may not
work. Additionally, this modifies the script file which may cause
a problem with some editors if you wish to make changes to it (since
it no longer has the expected CR LF sequence.
An alternative is to use striplf as a filter like this:
C:> striplf <script | debug
This should have no length limitation and does not adversely affect
the script file itself.
Bob Inman
Allentown, PA